const express = require('express');
const path = require('path');
const app = express();

app.use(express.urlencoded({ extended: true }));
app.use(express.static(path.join(__dirname, 'uploads')));

app.all('*', (req, res, next) => {
  res.header('Access-Control-Allow-Origin', '*');
  res.header('Access-Control-Allow-Method', 'GET,POST');
  next();
});

app.post('/file_upload', (req, res) => {
  res.send('ok');
});

app.listen(3001, () => {
  console.log('Express listened on 3001!');
});
